{% extends "pcadmin/pcadmin_base.html" %}
{% block globalconteiner %}


<h2>Создание задания: {{ task.title }} [{{ task.code }}].</h2>
<a href="{% url task_list %}">Другое задание</a>

{% if form.is_multipart %}
    <form enctype="multipart/form-data" method="post" action=".">
{% else %}
    <form method="post" action=".">
{% endif %}
<table class="table_layout">
<tr>
<td width="50%">
    <h3>Список агентов для задания:</h3>
    <table class="table_layout">
    {% for agent in agent_list %}
      <tr>
        <td><input type="checkbox"/ name="agent_id_{{ agent.id }}" {% if agent.id == agent_selected %}checked="checked"{% endif %} ></td>
        <td><a href="{% url agent_details agent.id %}">{{ agent.apid }}</a></td>
        <td>{{ agent.description }}</td>
        <td>{{ agent.last_conn_date }}</td>
      </tr>
    {% empty %}
        <tr><td>Sorry, no agent in this list!</td></tr>
    {% endfor %}
    </table>
</td>
<td width="50%">
    <h3>Параметры задания:</h3>
    <div>
        <fieldset class="aligned">
        {% for field in form %}
            <div class="form-row">
                {{ field.errors }}
                <div>
                    {{ field.label_tag }}
                    {{ field }}&nbsp;&nbsp;{% if field.field.required %}<font color="red">*</font>{% endif %}
                </div>
            </div>
        {% endfor %}
        </fieldset>
        <div>
            <input class="default" type="submit" name="_save" value="Сохранить"/>
        </div>
    </div>
</td>
</tr>
</table>
</form>

<script  type="text/javascript">
//addEvent(window, 'load', DateTimeShortcuts.init);
</script>

{% endblock %}